import yaml
from common.loggers import Logger


class OperYaml():

    @classmethod
    def reda_yaml(cls, yaml_file_path: str) -> dict:
        Logger.info(f'开始读取【{yaml_file_path}】')
        with open(yaml_file_path, 'r', encoding='utf-8') as file:
            data_yaml = yaml.load(file.read(), Loader=yaml.FullLoader)
            Logger.info(f'读取完成【{data_yaml}】')
            return data_yaml
